import {
  Slider,
  Input, Switch, Color, Radio, Link
} from '@/components/CustomPage/fields/widget'

export function moreLinkOps() {
  return [
    {
      type: Radio,
      option: {
        label: '查看更多展示',
        name: 'isMore',
        type: 'button',
        list: [{ name: '展示', value: '1' }, { name: '不展示', value: '2' }],
        layout: 'horizon',
        value: '2',
        override: function(ths, e) {
          ths.$nextTick(() => {
            for (let i = 0; i < ths.$parent.$parent.$children.length; i++) {
              if (ths.$parent.$parent.$children[i].option.name === 'moreLink') {
                ths.$parent.$parent.$children[i].visible = e === '1'
              }
            }
          })
        }
      }
    },
    { type: Link, option: { label: '查看更多地址', name: 'moreLink' }}
  ]
}
